import { ModuleComponentMappingModel } from './module-component.types';
import { CommonSpecialExperience } from '../components/CommonSpecialExperience';
import { CommonWorkExperience } from '../components/CommonWorkExperience';
import { ModuleComponentType } from './module-component.enum';
import { CommonEducationExperience } from '../components/CommonEducationExperience';
import { CommonProjectExperience } from '../components/CommonProjectExperience';

const ModuleComponentMapping: ModuleComponentMappingModel = {
    CommonEducationExperience: CommonEducationExperience,
    CommonWorkExperience: CommonWorkExperience,
    CommonProjectExperience: CommonProjectExperience,
    CommonSpecialExperience: CommonSpecialExperience,
};

function getModuleComponent(type: ModuleComponentType) {
    return ModuleComponentMapping?.[type] ?? CommonSpecialExperience;
}

export { ModuleComponentMapping, getModuleComponent };
